
/**
 * Created by user on 2018/12/7.
 */
import React from 'react'
import { Link } from 'react-router-dom'
import { Router } from 'react-router'
import reactDom from 'react-dom'
import MyRouter from './router'
import createHashHistory from 'history/createHashHistory'
const history = createHashHistory()
class AppRoot extends React.Component {
    render() {
        return (
            <Router history={history}>
                <div>
                    <h2>React Universal App</h2>
                    <Link to="/index"> index </Link>
                    <Link to="/user"> user </Link>
                    <Link to="/about"> about </Link>
                    {this.props.children}
                </div>
            </Router>
        )
    }
}

function App() {
    return (
        <AppRoot>
            <MyRouter/>
        </AppRoot>
    )
}

reactDom.render(<App/>, document.getElementById('react-root'))

// export default App
